package com.cloudoer.blog.mapper.dao;


import com.cloudoer.blog.mapper.ArticleMapper;
import com.cloudoer.blog.model.Article;
import com.cloudoer.blog.model.info.ArticleInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

public interface ArticleDao extends ArticleMapper {
    List<ArticleInfo> selectByPage(@Param(value = "pstart") Integer pstart,
                                   @Param(value = "psize") Integer psize);

    List<ArticleInfo> selectByPagePub(@Param(value = "pstart") Integer pstart,
                                      @Param(value = "psize") Integer psize,
                                      @Param(value = "state") String state);

    List<ArticleInfo> selectByRan(@Param(value = "pstart") Integer pstart,
                                      @Param(value = "psize") Integer psize,
                                      @Param(value = "state") String state);

    List<ArticleInfo> selectByEnd(@Param(value = "pstart") Integer pstart,
                                  @Param(value = "psize") Integer psize,
                                  @Param(value = "state") String state);

    ArticleInfo selectById (@Param(value = "id") String id);

    Integer selectCount();

    Integer selectCountByPub(@Param(value = "state") String state);
}
